#include <iostream>
using namespace std;

int main() {
    int k;
    int temp;
    cin >> k;
    int one_count = 0;
    int five_count = 0;
    int ten_count = 0;
    if (k <= 1 || k >= 100)
    {
        return 0;
    }
    for (int i = 0; i < k; i++)
    {
        cin >> temp;
        if (temp < 1 || temp > 10)
        {
            continue;
        }
        if (temp == 1)
        {
            one_count += 1;
        }
        if (temp == 5)
        {
            five_count += 1;
        }
        if (temp == 10)
        {
            ten_count += 1;
        }
    }
    cout << one_count << endl;
    cout << five_count << endl;
    cout << ten_count << endl;
    
    return 0;
}